<template>
  <div class="home-child">
    通过inject注入的属性值： {{ data.value }}
    <div class="slot-sope">
      作用域插槽 <br>
      <slot v-bind:user="user"></slot>
    </div>
  </div>
</template>

<script>
  export default {
    inject:['data'],
    data() {
      return {
        name: 'jiangxm',
        user: {
          firstName: '江',
          lastName: '学美'
        }
      }
    }
  }
</script>

<style lang="scss" scoped>
.home-child {
  .slot-sope {
    border: 1px solid green;
    width: 250px;
    height: 200px;
  }
}
</style>